package com.ww.springboot.sharding.config;

import com.ww.springboot.sharding.service.IOutOrderDetailsService;
import com.ww.springboot.sharding.vo.FindOrderVO;
import com.ww.springboot.sharding.vo.PageVO;
import lombok.AllArgsConstructor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.Date;

/**
 * shardingSphere 查询采用归并排序
 * <p>
 * 查询包含分片词 则也会调用分片规则进行优化
 *
 * @author wanwei
 * @since 2021-05-03 11:23
 */
@Configuration
@AllArgsConstructor
public class DataSelectTest {


    private IOutOrderDetailsService detailsService;

    @Bean
    public void select() {
        FindOrderVO findOrderVO = new FindOrderVO();
        findOrderVO.setTimeState("paidTime");
        findOrderVO.setStartDate(new Date());
        findOrderVO.setEndDate(new Date());

        //findOrderVO.setDgId(1L);
        PageVO pageVO = new PageVO();
        pageVO.setPageSize(10);
        pageVO.setPageStart(0);
        detailsService.selectOutOrderDetailsPage(findOrderVO, pageVO);
    }
}
